﻿package net.imonair.core.events {
	import flash.events.Event;
	import net.imonair.core.contacts.IIMContact;
	public class IMContactEvent extends Event {
		public static const CHANGE			:String = "contactChange";
		public static const STATUS_CHANGE	:String = "contactStatusChange";
		public static const NAME_CHANGE		:String = "contactNameChange";
		private var _relatedContact:IIMContact;
		public function IMContactEvent(type:String, relatedContact:IIMContact) {
			super(type, false, false);
			this._relatedContact = _relatedContact;
		}
		override public function get target():Object {
			return this._relatedContact;
		}
		public function get status():String {
			return this._relatedContact.status;
		}
		public function get simpleStatus():String {
			return this._relatedContact.simpleStatus;
		}
		override public function clone():Event {
			return new IMContactEvent(this.type, this.target as IIMContact);
		}
		override public function toString():String {
			return formatToString("IMContactEvent", "type", "bubbles", "cancelable", "status", "extendedstatus", "eventPhase");
		}
	}
}